package com.luxx.entity;

import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by luxx on 2017/11/2 0002.
 */
@MappedSuperclass
public abstract class BaseEntity implements Serializable {
    /**
     *  创建时间
     */
    public Date created;
    /**
     *  更新时间
     */
    public Date updated;
    public BaseEntity() {
        this.created = new Date();
        this.updated = created;
    }

    public BaseEntity(Date created) {
        this.created = created;
        this.updated = created;
    }

    //region **     Getter/Setter 方法    **
    public Date getCreated() {
        return created;
    }

    private void setCreated(Date created) {
        this.created = created;
        this.updated = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }
    //endregion

}
